home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / standard / stfe.z / stfe
Encoding:
Text File  |  1998-10-30  |  12.4 KB  |  265 lines

  1.  
  2.  
  3.  
  4. SSSSTTTTFFFFEEEE((((3333XXXX))))                                                              SSSSTTTTFFFFEEEE((((3333XXXX))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      stfe - routines that provide a high-level interface to basic functions
  10.      needed to access and add to the symbol table
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyymmmmssss....hhhh>>>>
  14.  
  15.      lllloooonnnngggg sssstttt____ffffiiiilllleeeebbbbeeeeggggiiiinnnn((((cccchhhhaaaarrrr ****ffffiiiilllleeeennnnaaaammmmeeee))));;;;
  16.  
  17.      lllloooonnnngggg sssstttt____eeeennnnddddaaaallllllllffffiiiilllleeeessss((((vvvvooooiiiidddd))));;;;
  18.  
  19.      lllloooonnnngggg sssstttt____ffffiiiilllleeeeeeeennnndddd((((lllloooonnnngggg iiiiddddnnnn))));;;;
  20.  
  21.      lllloooonnnngggg sssstttt____bbbblllloooocccckkkkbbbbeeeeggggiiiinnnn((((lllloooonnnngggg iiiissssssss,,,, lllloooonnnngggg vvvvaaaalllluuuueeee,,,, lllloooonnnngggg sssscccc))));;;;
  22.  
  23.      lllloooonnnngggg sssstttt____tttteeeexxxxttttbbbblllloooocccckkkk((((vvvvooooiiiidddd))));;;;
  24.  
  25.      lllloooonnnngggg sssstttt____bbbblllloooocccckkkkeeeennnndddd((((lllloooonnnngggg ssssiiiizzzzeeee))));;;;
  26.  
  27.      lllloooonnnngggg sssstttt____pppprrrroooocccceeeennnndddd((((lllloooonnnngggg iiiiddddnnnn))));;;;
  28.  
  29.      lllloooonnnngggg sssstttt____pppprrrrooooccccbbbbeeeeggggiiiinnnn((((lllloooonnnngggg iiiiddddnnnn))));;;;
  30.  
  31.      cccchhhhaaaarrrr ****sssstttt____ssssttttrrrr____iiiiddddnnnn((((lllloooonnnngggg iiiiddddnnnn))));;;;
  32.  
  33.      cccchhhhaaaarrrr ****sssstttt____ssssyyyymmmm____iiiiddddnnnn((((lllloooonnnngggg iiiiddddnnnn,,,, lllloooonnnngggg ****sssscccc,,,, lllloooonnnngggg ****sssstttt,,,, lllloooonnnngggg ****vvvvaaaalllluuuueeee,,,, lllloooonnnngggg ****iiiinnnnddddeeeexxxx))));;;;
  34.  
  35.      lllloooonnnngggg sssstttt____aaaabbbbssss____iiiiffffdddd____iiiinnnnddddeeeexxxx((((lllloooonnnngggg iiiiffffdddd,,,, lllloooonnnngggg iiiinnnnddddeeeexxxx))));;;;
  36.  
  37.      lllloooonnnngggg sssstttt____ffffgggglllloooobbbbaaaallll____iiiiddddnnnn((((lllloooonnnngggg iiiiddddnnnn))));;;;
  38.  
  39.      ppppSSSSYYYYMMMMRRRR sssstttt____ppppssssyyyymmmm____iiiiddddnnnn____ooooffffffffsssseeeetttt((((lllloooonnnngggg iiiiddddnnnn;;;; lllloooonnnngggg ooooffffffffsssseeeetttt))));;;;
  40.  
  41.      lllloooonnnngggg sssstttt____ppppddddaaaadddddddd____iiiiddddnnnn((((lllloooonnnngggg iiiiddddnnnn))));;;;
  42.  
  43. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  44.      The _s_t_f_e routines provide a high-level interface to the symbol table
  45.      based on common needs of the compiler front-ends.
  46.  
  47.      _s_t__f_i_l_e_b_e_g_i_n
  48.              Takes a file name and calls _s_t__f_d_a_d_d (see the _s_t_f_d manual page).
  49.              If it's a new file, a symbol is added to the symbol table for it
  50.              and the user supplied routine, _s_t__f_e_i_n_i_t, is called. This allows
  51.              special once per file things to be initialized (for example, the
  52.              C front-end adds basic type auxiliaries to each file's aux table
  53.              so that all variables of that type can refer to a single instance
  54.              instead of making individual copies of them). _s_t__f_i_l_e_b_e_g_i_n
  55.              returns a dense number that references the symbol added for this
  56.              file.  It tracks files as they appear in a CPP line directive
  57.              with a stack.  It detects (from the order of the CPP directives)
  58.              that a file ends and calls _s_t__f_i_l_e_n_d.  If a file is closed with a
  59.              _s_t__f_i_l_e_e_n_d, a new instance of the filename is created (for
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSTTTTFFFFEEEE((((3333XXXX))))                                                              SSSSTTTTFFFFEEEE((((3333XXXX))))
  71.  
  72.  
  73.  
  74.              example, multiply included files).
  75.  
  76.      _s_t__f_i_l_e_e_n_d
  77.              Requires the dense number from the corresponding _s_t__f_i_l_e_b_e_g_i_n
  78.              call for the file in question. It then generates an end symbol
  79.              and patches the references so that the index field of the begin
  80.              file points to that of one beyond the end file. The end file
  81.              points to the begin file.
  82.  
  83.      _s_t__e_n_d_a_l_l_f_i_l_e_s
  84.              Is called at the end of execution to close off all files that
  85.              haven't been ended by previous calls to _s_t__f_i_l_e_b_e_g_i_n. CPP
  86.              directives might not reflect the return to the original source
  87.              file; therefore, this routine can possibly close many files.
  88.  
  89.      _s_t__b_l_o_c_k_b_e_g_i_n
  90.              Supports language blocks (for example, C's left curly brace
  91.              blocks), beginning of structures, and unions. If the storage
  92.              class is scText, it is the former; if it is scInfo, it is one of
  93.              the latter.  The iss (index into string space) specifies the name
  94.              of the structure/etc, if any.
  95.  
  96.      If the storage class is scText, we must check the result of
  97.      _s_t__b_l_o_c_k_b_e_g_i_n.  It returns a dense number for outer blocks and a zero for
  98.      nested blocks.  The non-zero block number should be used in the BGNB
  99.      ucode.  Users of languages without nested blocks that provide variable
  100.      declarations can ignore the rest of this paragraph.  Nested blocks are
  101.      two-staged: one stage happens when we detect the language block and the
  102.      other stage happens when we know the block has content. If the block has
  103.      content (for example, local variables), the front-end must call
  104.      _s_t__t_e_x_t_b_l_o_c_k to get a non-zero dense number for the block's BGNB ucode.
  105.      If the block has no content and _s_t__t_e_x_t_b_l_o_c_k is not called, the block's
  106.      _s_t__b_l_o_c_k_b_e_g_i_n and _s_t__b_l_o_c_k_e_n_d do not produce block and end symbols.
  107.  
  108.      If it is scInfo, _s_t__b_l_o_c_k_b_e_g_i_n creates a begin block symbol in the symbol
  109.      table and returns a dense number referencing it. The dense number is
  110.      necessary to build the auxiliary required to reference the structure/etc.
  111.      It goes in the aux after the TIR along with a file index. This dense
  112.      number is also noted in a stack of blocks used by _s_t__b_l_o_c_k_e_n_d.
  113.  
  114.      _s_t__b_l_o_c_k_b_e_g_i_n should not be called for language blocks when the front-end
  115.      is not producing debugging symbols.
  116.  
  117.      _s_t__b_l_o_c_k_e_n_d requires that blocks occur in a nested fashion. It retrieves
  118.      the dense number for the most recently started block and creates a
  119.      corresponding end symbol. As in _f_i_l_e_e_n_d, both the begin and end symbol
  120.      index fields point at the other end's symbol.  If the symbol ends a
  121.      structure/etc., as determined by the storage class of the begin symbol,
  122.      the size parameter is assigned to the begin symbol's value field.  It's
  123.      usually the size of the structure or max value of a enum.  We only know
  124.      it at this point. The dense number of the end symbol is returned so that
  125.      the ucode ENDB can be use it.  If it is an ignored text block, the dense
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSTTTTFFFFEEEE((((3333XXXX))))                                                              SSSSTTTTFFFFEEEE((((3333XXXX))))
  137.  
  138.  
  139.  
  140.      number is zero and no ENDB should be generated.
  141.  
  142.      In general, defined external procedures or functions appear in the
  143.      symbols table and the externals table. The external table definition must
  144.      occur first through the use of a _s_t__e_x_t_a_d_d.  After that definition,
  145.      _s_t__p_r_o_c_b_e_g_i_n can be called with a dense number referring to the external
  146.      symbol for that procedure. It checks to be sure we have a defined
  147.      procedure (by checking the storage class). It adds a procedure symbol to
  148.      the symbol table. The external's index should point at its auxiliary data
  149.      type information (or if debugging is off, indexNil).  This index is
  150.      copied into the regular symbol's index field or a copy of its type is
  151.      generated (if the external is in a different file than the regular
  152.      symbol).  Next, we put the index to symbol in the external's index field.
  153.      The external's dense number is used as a block number in ucodes
  154.      referencing it and is used to add a procedure when in the _s_t__p_d_a_d_d__i_d_n.
  155.  
  156.      _s_t__p_r_o_c_e_n_d
  157.              Creates an end symbol and fixes the indices as in _b_l_o_c_k_e_n_d and
  158.              _f_i_l_e_e_n_d, except that the end procedure reference is kept in the
  159.              begin procedure's aux rather than in the index field (because the
  160.              begin procedure has a type as well as an end reference). This
  161.              must be called with the dense number of the procedure's external
  162.              symbol as an argument and returns the dense number of the end
  163.              symbol to be used in the END ucode.
  164.  
  165.      _s_t__s_t_r__i_d_n
  166.              Returns the string associated with symbol or external referenced
  167.              by the dense number argument. If the symbol was anonymous (for
  168.              example, there was no symbol) a (char *)-1 is returned.
  169.  
  170.      _s_t__s_y_m__i_d_n
  171.              Returns the same result as _s_t__s_t_r__i_d_n, except that the rest of
  172.              the fields of the symbol specified by the _i_d_n are returned in the
  173.              arguments.
  174.  
  175.      _s_t__f_g_l_o_b_a_l__i_d_n
  176.              Returns a 1 if the symbol associated with the specified idn is
  177.              non-static; otherwise, a 0 is returned.
  178.  
  179.      _s_t__a_b_s__i_f_d__i_n_d_e_x
  180.              Returns the absolute offset for a dense number. If the symbol is
  181.              global, the global's index is returned. If the symbol occurred in
  182.              a file, the sum of all symbols in files occurring before that
  183.              file and the symbol's index within the file is returned.
  184.  
  185.      _s_t__p_d_a_d_d__i_d_n
  186.              Adds an entry to the procedure table for the _s_t__p_r_o_c _e_n_t_r_y
  187.              generated by procbegin. This should be called when the front-end
  188.              generates code for the procedure in question.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SSSSTTTTFFFFEEEE((((3333XXXX))))                                                              SSSSTTTTFFFFEEEE((((3333XXXX))))
  203.  
  204.  
  205.  
  206.      The programs must be loaded with the object file access routine library
  207.      libmld.a.
  208.  
  209. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  210.      stcu(3x), stfd(3x)
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.